<?php

include('../config.php');
//接受前段传来的数据
$name = $_GET['name'];
$price = $_GET['price'];
$num = $_GET['num'];

$sql = "insert into shop (name,price,num) values('$name',$price,$num)";

$res = mysql_query($sql);

if($res){
    echo json_encode(array(
        "code" => 200,
        "body" => array(
            "msg" => "添加成功"
        )
        ));
}else{
    echo json_encode(array(
        "code" => 400,
        "body" => array(
            "msg" => "添加失败，请稍后再次尝试"
        )
        ));
}
?>
